;; Pair.scm
;; we treat 2-elem-lists (like '(1 2)) as pairs
;; rather than the original pairs (like '(1 . 2))

(load "Utils.scm")

;; a-pair? : whether x is a 2-elem-list

(define a-pair?
  (lambda (x)
    (cond
      ((atom? x) #f)
      ((null? x) #f)
      ((null? (cdr x) #f))
      ((null? (cddr x) #t))
      (else #f))))

;; buid pairs and extracting elems from pairs

(define build
  (lambda (s1 s2)
    (cons s1 (cons s2 '()))))

;; use first and second in Utils.scm to visit the 1st/2nd elem in the pair